<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form CActiveForm */
?>
<style>
#User_user_sex label {display: inline-block;}
</style>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">带<span class="required">*</span>的项目必填.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>32,'maxlength'=>32)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'user_email'); ?>
		<?php echo $form->textField($model,'user_email',array('size'=>60,'maxlength'=>64)); ?>
		<?php echo $form->error($model,'user_email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'user_sex'); ?>
		<?php //echo $form->textField($model,'user_sex'); ?>
		<?php echo $form->radioButtonList($model,'user_sex',array(1=>'男',2=>'女',3=>'保密'),array('separator'=>'&nbsp;')); ?>
		<?php echo $form->error($model,'user_sex'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'user_qq'); ?>
		<?php echo $form->textField($model,'user_qq',array('size'=>32,'maxlength'=>32)); ?>
		<?php echo $form->error($model,'user_qq'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'user_tel'); ?>
		<?php echo $form->textField($model,'user_tel',array('size'=>32,'maxlength'=>32)); ?>
		<?php echo $form->error($model,'user_tel'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'user_introduce'); ?>
		<?php //echo $form->textArea($model,'user_introduce',array('rows'=>6, 'cols'=>50)); ?>
		<?php $this->widget('ext.KEditor.KEditor',array(  
					'model'=>$model,  //传入form model  
					'name'=>'user_introduce', //设置name  
					'properties'=>array(  
						//设置接收文件上传的action  
						'uploadJson'=>'index.php?r=admin/user/upload',  
						//设置浏览服务器文件的action，这两个就是上面配置在/admin/default的  
						'fileManagerJson'=>'index.php?r=admin/user/manageJson',  
						'items'=>array('source', '|', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',  'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|',   'link','unlink'),
						'newlineTag'=>'br',  
						'allowFileManager'=>true,  
						//传值前加js:来标记这些是js代码  
						'afterCreate'=>"js:function() {  
								K('#ChapterForm_all_len').val(this.count());  
								K('#ChapterForm_word_len').val(this.count('text'));  
							}",  
						'afterChange'=>"js:function() {  
								K('#ChapterForm_all_len').val(this.count());  
								K('#ChapterForm_word_len').val(this.count('text'));  
							}",  
					),   
					'textareaOptions'=>array(  
						'style'=>'width:500px;height:200px;',  
					)  
				)); ?> 
		<?php echo $form->error($model,'user_introduce'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '新建' : '保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->